The present invention is directed to apparatus and method for transferring data stored in a volatile storage medium (e.g., random access memory) to a non-volatile storage medium (e.g., a hard drive), particularly to allow transition to a zero-volt suspend state. The present invention is also directed to the restoring of such data to the volatile storage medium, particularly when power is resumed. More particularly, the present invention is directed to such apparatus and method where data compression is used to increase the speed of the data transfers.
An advanced power management standard, termed the "Advanced Configuration Power Interface" (ACPI), has been proposed by Intel Corporation of Santa Clara, Calif., Microsoft Corporation of Redmond, Wash., and Toshiba Corporation of Tokyo, Japan. According to the ACPI specification, the operating system rather than the basic input/output system (BIOS) controls power management, thermal states, and plug-and-play (wherein enumeration and configuration of motherboard devices is performed by the operating system) functionality of the computer. This allows the operating system to evolve independently from the hardware, so that ACPI-compatible computers can gain the benefits of improvements and innovations in the operating system. Furthermore, this allows the hardware to evolve independently from the operating system, thereby decoupling hardware and operating system ship cycles.
The ACPI specification describes a range of global system states between the OFF state and the fully ON state. The global system states apply to the entire system, and the state of the system at any instant is apparent to the user. The ACPI specification also describes a range of device power states between the OFF state and the fully ON state; these states are generally not apparent to the user. For instance, to save power a laptop computer may allow the hard drive to go into a "sleep" state where the disc of the hard drive is not spinning. When in this "spin-down" state, the hard drive is still available to the operating system. However, access to data on the hard drive is not as rapid, since the disc of the hard drive must be "spun up" to its full rotation speed before data on the drive can be accessed. So, although the functionality of the hard drive is reduced, the power consumption can be greatly reduced.
According to the ACPI specification, the system sleep levels are labeled as S0, S1, S2, S3, S4 and S5, with S5 having the lowest power consumption and the lowest functionality, and S0 being a fully operational state with the greatest power consumption. The S5 state is termed the "soft off" state. In transition to the S5 state, no context is saved by the operating system or the hardware. When the S5 state is initiated, the hardware will sequence the system to a state that is similar to the traditional "off" state. The hardware has no responsibility for maintaining any system context, however, it does allow for a wake-up to be initiated by pressing the power button, whereupon the BIOS does a normal power-on reset.
State S4, termed the "zero-volt suspend" state, differs from S5 only in that in transition to the S4 state the operating system (S4/08) or BIOS (S4/BIOS)is responsible for saving all system context (i.e., the status of various system devices, BIOS information, information regarding what applications are open and what data files have been modified but not saved, etc.) by saving the data stored in RAM to non-volatile storage. In the zero-volt suspend state the machine draws almost zero power and retains system context for an arbitrary period of time, years or decades if needed. Upon awakening from the zero-volt suspend state, the operating system restores the system to the state that it was in just prior to entering the zero-volt suspend state.
However, in the S4 state the system hardware context is lost--the hardware will sequence the system to a state that is similar to the S5 state, but has no responsibility for maintaining any system context. The hardware does allow the enabling of certain wake-up events, and upon waking up, the BIOS does a normal power-on reset.
Unfortunately, the amount of time required to transfer the system context information directly between RAM and the hard drive for user requested transitions to and from the S4 zero-volt suspend state tends to be long from the user's perspective, making the system appear sluggish. Furthermore, the transition time to the S4 zero-volt suspend state is even more critical when there is an unexpected power loss or shut down, such as when: the battery runs low or is accidentally removed on a laptop computer; a computer reaches its critical thermal limit and must be shut down to prevent damage; or, there is power loss to the UPS (uninterruptible power supply) of a server, in which case there is generally about five minutes of back-up power available.
Scanning for 64 kilobyte blocks of zeroes and substituting a signature word representing each zero block (thereby effecting a compression) is known in the art as a way of speeding these data transfers. However, the processing time required to perform more sophisticated compression schemes has been considered to be prohibitive. Of issue in any method used to increase the speed of the transition to the zero-volt suspend state is the robustness of the method in view of variations in the types of data in RAM that need to be stored--given that the time available to perform a zero-volt suspend may be uncertain, the compression which is used must generally increase the speed of the data transfer, and in cases where the speed of the transfer is actually lengthened, the amount by which it is lengthened must be by a very small percentage.
Therefore, an object of the present invention is therefore to provide a method for speeding the transfer of data, particularly configuration data stored in volatile memory to non-volatile memory, and particularly for the purpose of preparing the system for a transition to a low-power suspend state.
Another object of the present invention is to provide a method for speeding the transfer of data which was previously saved from volatile memory to non-volatile memory, back to the volatile memory, particularly for the purpose of resuming operation after a transition from a low-power state to a normal operating state.
A further object of the present invention is to provide a method for increasing a data transfer rate by compressing data, particularly system context data, which generally provides an increase in the speed of the data transfer, and in cases where the speed of the transfer is lengthened, the amount by which it is lengthened must be small.
Still another object of the present invention is to provide a method for compressing segments of data of a variety of types and/or sizes.
Further objects and advantages of the present invention will become apparent from a consideration of the drawings and the ensuing detailed description.